<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>{$config['admin_name']}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="/static/third/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/bews/css/index.css" media="all">
	<script type="text/javascript" src="/static/third/layui/layui.js"></script>
	<script type="text/javascript" src="/static/bews/js/admin.js"></script>
	<style>
		.layadmin-side-shrink .layui-layout-admin .layui-logo {
			width: 60px;
			background-image:url("/static/bews/images/logob32.jpg");
		}
	</style>
</head>
<body layadmin-themealias="default" class="layui-layout-body">
	<div id="LAY_app" class="layadmin-tabspage-none">
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<!-- 头部区域 -->
				<ul class="layui-nav layui-layout-left">
					<li class="layui-nav-item layadmin-flexible" lay-unselect onclick="shrink()">
						<a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
							<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
						</a>
					</li>
				</ul>
				<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
					<li class="layui-nav-item layui-hide-xs" lay-unselect title="全屏" onclick="fullScreen()">
						<a href="javascript:;" layadmin-event="fullscreen">
							<i class="layui-icon layui-icon-screen-full"></i>
						</a>
					</li>
					<li class="layui-nav-item" lay-unselect>
						<a href="javascript:;">
							<cite>{$aUser['name']}</cite>
						</a>
						<dl class="layui-nav-child">
							<dd><a lay-href="" onclick="menuFire('bewadmin/admininfo',1)">个人中心</a></dd>
							<hr>
							<dd layadmin-event="logout" style="text-align:center;" onclick="logout()">
								<a>退出</a>
							</dd>
						</dl>
					</li>
				</ul>
			</div>
			<!-- 侧边菜单 -->
			<div class="layui-side layui-side-menu">
				<div class="layui-side-scroll">
					<div class="layui-logo" lay-href="">
						<span>{$config['admin_name']}</span>
					</div>
					<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
						{volist name="menu" id="vo"}
							<li data-name="" data-jump="" class="layui-nav-item">
								<a href="javascript:;" lay-tips="{$vo['label']}" lay-direction="2">
									<i class="layui-icon layui-icons {$vo['icon_class']}"></i>
									<cite>{$vo['label']}</cite>
								</a>
								{if (isset($vo['children']) && $vo['children'])}
									<dl class="layui-nav-child">
										{volist name="vo.children" id="cvo"}
											<dd data-name="" data-jump="/">
												{if $cvo['type'] == 1}
													<a href="javascript:;" onclick="menuFire('{$cvo.src}',1)">
														<i class="layui-icon layui-icons {$cvo.icon_class}"></i>{$cvo.label}
													</a>
												{elseif $cvo['type'] == 2 /}
													<a href="{$cvo.src}" target="_blank">
														<i class="layui-icon layui-icons {$cvo.icon_class}"></i>{$cvo.label}
													</a>
												{/if}
											</dd>
										{/volist}
									</dl>
								{/if}
							</li>
						{/volist}
					</ul>
				</div>
			</div>
			<!-- 主体内容 -->
			<div class="layui-body" id="LAY_app_body">
				<div class="layadmin-tabsbody-item layui-show">
					<div class="layui-fluid">
						<div class="layui-card">
							<iframe src="{$config['admin_route']}index/welcome" onload="resetMainHeight(this)" style="width:100%;height:100%;" frameborder="0" scrolling="0"></iframe>
						</div>
					</div>
				</div>
			</div>
			<!-- 辅助元素，一般用于移动设备下遮罩 -->
			<div class="layadmin-body-shade" layadmin-event="shade" onclick="shrink()"></div>
		</div>
	</div>
	<!-- 辅助元素，一般用于移动设备下遮罩 -->
	<div class="layadmin-body-shade" layadmin-event="shade"></div>
	</div></div>
	<script type="text/javascript">
		layui.use(['element','layer','jquery'], function(){
			var element = layui.element;
			$ = layui.jquery;
			layer = layui.layer;
			setter = layui.setter;
			$('#clearcache').on('click',function(){
				$.ajax({
					url: "{$config['admin_route']}index/clear",
					success: function (res) {
						if(res.code>0){
							layer.msg(res.msg,{'icon':2});
						}else{
							layer.msg(res.msg,{'icon':1});
							setTimeout(function(){parent.window.location.reload();},1000);
						}
					}
				});
				return false;
			});
		});
		// 重新设置主操作页面高度
		function resetMainHeight(obj){
			var height = parent.document.documentElement.clientHeight - 80;
			$(obj).parent('div').height(height);
		}
		// 菜单点击
		function menuFire(obj,num){
			if(num == 1){
				$('iframe').attr('src',"{$config['admin_route']}"+obj);
			}
			var width = screen();
			if(width < 2){
				shrink();
			}
		}
		// 退出
		function logout(){
			layer.confirm('确定要退出吗？', {
				icon:3,
				btn: ['确定','取消']
			}, function(){
				$.get("{$config['admin_route']}login/logout",function(res){
					if(res.code>0){
						layer.msg(res.msg,{'icon':2});
					}else{
						layer.msg(res.msg,{'icon':1});
						setTimeout(function(){window.location.href="{$config['admin_route']}login/index";},1000);
					}
				},'json');
			});
		}
	</script>
</body>
</html>